﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/// <summary>
/// 境阶加成表
/// </summary>
[Serializable]
public class RoleUp
{
    /// <summary>
    /// 渡劫阶段
    /// </summary>
    public int level;
    /// <summary>
    /// 加成
    /// </summary>
    public int up_value;

    public string ToShowInfo()
    {
        return string.Format("攻击+{0}%({1}激活)", up_value, CommonUtil.GetDuJieName(level));
    }
}

public class RoleUpMgr
{
    public static Dictionary<int, RoleUp> Dict { get; private set; }

    public static void Load()
    {
        List<RoleUp> initRoles = StaticDataReader.LoadJsonFromFile<RoleUp>("static_hero_up");
        if (initRoles != null)
        {
            Dict = new Dictionary<int, RoleUp>(initRoles.Count);
            for(int i=0; i<initRoles.Count; i++)
            {
                Dict.Add(initRoles[i].level, initRoles[i]);
            }
        }
        else
        {
            Dict = new Dictionary<int, RoleUp>();
        }
    }
}
